package com.common.BearMethods;

import com.common.BearBean.ChuZhiBean;
import com.common.BearBean.JiFenListBean;
import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.utils.SortUtils;

import java.util.ArrayList;

import rx.Observable;
import rx.Subscriber;

public class GetJiFenListMethods extends BaseMethods {

    private static GetJiFenListMethods m_ins = null;

    public static GetJiFenListMethods getInstance() {
        if (m_ins == null) {
            synchronized (GetJiFenListMethods.class) {
                if (m_ins == null) {
                    m_ins = new GetJiFenListMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "api/Shop/";
    }

    private BearService initService() {
        return getRetrofit().create(BearService.class);
    }


    public void     getScoreList          (Subscriber<ArrayList<JiFenListBean>> subscriber,
                      String uid ,
                      String hashid,
                      int    page,
                      String vipcardid,
                      String deptcode
    ) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().getScoreList (time,
                SortUtils.getMyHash("time"+time,"uid"+uid
                        ,"hashid"+hashid
                        ,"page"+page
                        ,"clientcode"+vipcardid
                        ,"search"+deptcode

                ), Constans.ANDROID_APP_ID,"3",
              uid,hashid,page,vipcardid,deptcode
        );
        toSubscribe(observable, subscriber);
    }
}
